home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 January: Mac OS SDK / Dev.CD Jan 96 SDK / Dev.CD Jan 96 SDK1.toast / Development Kits (Disc 1) / MacODBC / ODBC Tools / SampleApp / AutoTests.h next >
Encoding:
C/C++ Source or Header  |  1995-03-22  |  4.1 KB  |  118 lines  |  [TEXT/MPS ]

  1. /*
  2.  *    AutoTests.h
  3.  *
  4.  *    Copyright:    © 1993 by Apple Computer, Inc., all rights reserved.
  5.  *    Copyright:    © 1995 by Visigenic Software, Inc., all rights reserved.
  6.  *
  7.  *    950320    KO    I have hacked the ODBC 1.0 header file to work with the
  8.  *    QuickTest source from the Windows 2.0 SDK.  The intention is to allow
  9.  *    the 2.0 QuickTest to work with the 1.0 ODBC Test.
  10.  *
  11.  */
  12.  
  13. #ifndef __AUTOTESTS
  14. #define __AUTOTESTS
  15. #include "SQL.H"
  16. #include "SQLEXT.H"
  17.  
  18. #include "macdefs.h"
  19.  
  20. /*
  21.  * The parameter block passed into DoAutoTest, the auto test shared library's
  22.  *    function which performs the test.
  23.  *    This is the ODBC Test 1.0 parameter block from the Mac ODBC 1.0 SDK.
  24.  */
  25.  
  26. typedef struct
  27. {
  28.     char    szSource[20];
  29.     char    szValidServer0[20]; /* if this is an empty string then hdbc should be used */
  30.     char    szValidServer1[20];
  31.     char    szValidLogin0[20];
  32.     char    szValidLogin1[20];
  33.     char    szValidPassword0[20];
  34.     char    szValidPassword1[20];
  35.     char    szValidQuery0[200];
  36.     char    szParamQuery0[300];
  37.     char    szParam0[20];
  38.     long    *rglMask;
  39.     GrafPtr    pGrafPort;            /* this can be used as the GrafPort pointer for DriverConnect*/
  40.     HENV    henv;                /* these are used when the connection being tested */
  41.     HDBC    hdbc;                  /* is the current connection in ODBC Test */
  42.     int        cErrors;            /* contains the number of errors encountered during the test run */
  43.     int        cStateErrors;        /* contains the number of error states encountered during the test run */
  44.     pascal void    (*ControlSzWrite)(int, int);
  45.     pascal void (*szWrite)( char*, BOOL);
  46. } ServerStruct;
  47.  
  48. /*
  49.  *    The function set parent id - this is used to find all of the auto test
  50.  *    shared libraries. Auto test shared libraries MUST have this as their
  51.  *    function set parent id.
  52.  */
  53.  
  54. #define kAutoTestParentID                "appl:ODBC$AutoTestParentId"
  55.  
  56.  
  57. /* 950317 KO    Added this definition to this header file to support the porting    */
  58. /** of the QuickTest from ODBC 2.0 SDK from Windows.                                */
  59. #if ODBCVER >= 0x0200
  60.  
  61. /* 950317 KO    The following defines will need to be checked against Mac    */
  62. /** and Windows.  I have just defined them here for expediency.                */
  63.  
  64. #define _MAX_PATH            256
  65. #define MAX_USER_INFO        256
  66. #define MAX_KEYWORD_LEN        32
  67. #define MAXFLUSH            4096
  68.  
  69. //
  70. // This structure contains the information found in the .INI file for a 
  71. //    data source.  The filled out structure is in turn passed to AutoTestFunc
  72. //    to drive the individual tests.
  73. //    This is the ODBC Test 2.0 parameter block used by ODBC Test in the 
  74. //    Windows 2.0 SDK.
  75. //
  76. typedef struct tagSERVERINFO {
  77.     HWND             hwnd;                                // Output edit window
  78.     char               szLogFile[_MAX_PATH];                // Output log file
  79.     HENV             henv;                                // .EXE's henv
  80.     HDBC             hdbc;                                // .EXE's hdbc
  81.     HSTMT            hstmt;                                // .EXE's hstmt
  82.  
  83.     // The following items are gathered from the .INI file and may be defined
  84.     //        via the "Manage Test Sources" menu item from ODBC Test
  85.     char             szSource[SQL_MAX_DSN_LENGTH+1];
  86.     char             szValidServer0[SQL_MAX_DSN_LENGTH+1];
  87.     char             szValidLogin0[MAX_USER_INFO+1];
  88.     char             szValidPassword0[MAX_USER_INFO+1];
  89.     char            szKeywords[MAX_KEYWORD_LEN+1];
  90.  
  91.     // Following are used for run-time
  92.     UINT FAR *        rglMask;                              // Run test mask
  93.     int              failed;                                // Track failures on a test case basis
  94.     int              cErrors;                            // Count of errors
  95.     BOOL             fDebug;                                // TRUE if debugging is to be enabled
  96.     BOOL             fScreen;                            // TRUE if test output goes to screen
  97.     BOOL             fLog;                                // TRUE if test output goes to log
  98.     BOOL             fIsolate;                            // TRUE to isolate output
  99.     UDWORD            vCursorLib;                            // Value for SQL_ODBC_CURSOR on SQLSetConnectOption
  100.     HINSTANCE        hLoadedInst;                        // Instance handle of loaded test
  101.  
  102.     // Following are used for buffering output to edit window
  103.     char            szBuff[MAXFLUSH];                    // Hold temporary results
  104.     UINT            cBuff;                                // Number of chars in szBuff
  105.     } SERVERINFO;
  106. typedef SERVERINFO FAR * lpSERVERINFO;
  107.  
  108. /* 950317 KO    I have limited the szLogPrintf routine to just passing 1 string for now    */
  109. /** This is what the QuickTest dll does anyway.  Just trying to get someting working.    */
  110.  
  111. BOOL_EXTFUNCDECL_FAR szLogPrintf(lpSERVERINFO lps, BOOL fForce, LPSTR szFmt /*, ...*/);
  112.  
  113. void_CALLBACK AutoTestFunc(lpSERVERINFO pTestSource);
  114. BOOL_CALLBACK AutoTestName(LPSTR szName, UINT FAR * cbTestCases);
  115.  
  116. #endif
  117.  
  118. #endif